<!DOCTYPE html>
<html lang="zh-hans">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/wow/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/wow/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/wow/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/wow/images/logo.svg" color="#222">

<link rel="stylesheet" href="/wow/css/main.css">



<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.3/css/all.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css">

<script class="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"single-flower.gitee.io","root":"/wow/","images":"/wow/images","scheme":"Muse","version":"8.3.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"بحث...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"}};
  </script>
<meta name="description" content="什么是面向过程和面向对象面向对象三要素面向对象五大原则面向对象的mrosuper()方法self指针isinstance方法python中的魔法方法特殊的魔法方法静态，类方法的区别类中装饰器property元类反射猴子补丁什么是面向过程和面向对象--有一天你想吃鱼香肉丝了，怎么办呢？你有两个选择 1、自己买材料，肉，鱼香肉丝调料，蒜苔，胡萝卜等等然后切菜切肉，开炒，盛到盘子里。 2、去饭店，张开嘴">
<meta property="og:type" content="article">
<meta property="og:title" content="面向对象9">
<meta property="og:url" content="https://single-flower.gitee.io/wow/2021/04/13/SD/%E9%9D%A2%E8%AF%95%E9%A2%98_%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A19/index.html">
<meta property="og:site_name" content="朵朵最可爱">
<meta property="og:description" content="什么是面向过程和面向对象面向对象三要素面向对象五大原则面向对象的mrosuper()方法self指针isinstance方法python中的魔法方法特殊的魔法方法静态，类方法的区别类中装饰器property元类反射猴子补丁什么是面向过程和面向对象--有一天你想吃鱼香肉丝了，怎么办呢？你有两个选择 1、自己买材料，肉，鱼香肉丝调料，蒜苔，胡萝卜等等然后切菜切肉，开炒，盛到盘子里。 2、去饭店，张开嘴">
<meta property="og:locale">
<meta property="article:published_time" content="2021-04-13T06:15:03.962Z">
<meta property="article:modified_time" content="2021-04-15T13:14:06.819Z">
<meta property="article:author" content="X y">
<meta property="article:tag" content="-GIT">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://single-flower.gitee.io/wow/2021/04/13/SD/%E9%9D%A2%E8%AF%95%E9%A2%98_%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A19/">


<script class="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-hans'
  };
</script>
<title>面向对象9 | 朵朵最可爱</title>
  




  <noscript>
  <style>
  body { margin-top: 2rem; }

  .use-motion .menu-item,
  .use-motion .sidebar,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header {
    visibility: visible;
  }

  .use-motion .header,
  .use-motion .site-brand-container .toggle,
  .use-motion .footer { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle,
  .use-motion .custom-logo-image {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line {
    transform: scaleX(1);
  }

  .search-pop-overlay, .sidebar-nav { display: none; }
  .sidebar-panel { display: block; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="تشغيل شريط التصفح" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/wow/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">朵朵最可爱</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu">
        <li class="menu-item menu-item-home"><a href="/wow/" rel="section"><i class="fa fa-home fa-fw"></i>Home</a></li>
        <li class="menu-item menu-item-about"><a href="/wow/about/" rel="section"><i class="fa fa-user fa-fw"></i>معلومات</a></li>
        <li class="menu-item menu-item-tags"><a href="/wow/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>الوسوم</a></li>
        <li class="menu-item menu-item-categories"><a href="/wow/categories/" rel="section"><i class="fa fa-th fa-fw"></i>التصنيفات</a></li>
        <li class="menu-item menu-item-archives"><a href="/wow/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>الأرشيفات</a></li>
  </ul>
</nav>




</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          المحتويات
        </li>
        <li class="sidebar-nav-overview">
          عام
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BB%80%E4%B9%88%E6%98%AF%E9%9D%A2%E5%90%91%E8%BF%87%E7%A8%8B%E5%92%8C%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1"><span class="nav-number">1.</span> <span class="nav-text">什么是面向过程和面向对象</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E4%B8%89%E8%A6%81%E7%B4%A0"><span class="nav-number">2.</span> <span class="nav-text">面向对象三要素</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E4%BA%94%E5%A4%A7%E5%8E%9F%E5%88%99"><span class="nav-number">3.</span> <span class="nav-text">面向对象五大原则</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E7%9A%84mro"><span class="nav-number">4.</span> <span class="nav-text">面向对象的mro</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#super-%E6%96%B9%E6%B3%95"><span class="nav-number">5.</span> <span class="nav-text">super()方法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#self%E6%8C%87%E9%92%88"><span class="nav-number">6.</span> <span class="nav-text">self指针</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#isinstance%E6%96%B9%E6%B3%95"><span class="nav-number">7.</span> <span class="nav-text">isinstance方法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#python%E4%B8%AD%E7%9A%84%E9%AD%94%E6%B3%95%E6%96%B9%E6%B3%95"><span class="nav-number">8.</span> <span class="nav-text">python中的魔法方法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%89%B9%E6%AE%8A%E7%9A%84%E9%AD%94%E6%B3%95%E6%96%B9%E6%B3%95"><span class="nav-number">9.</span> <span class="nav-text">特殊的魔法方法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%9D%99%E6%80%81%EF%BC%8C%E7%B1%BB%E6%96%B9%E6%B3%95%E7%9A%84%E5%8C%BA%E5%88%AB"><span class="nav-number">10.</span> <span class="nav-text">静态，类方法的区别</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%B1%BB%E4%B8%AD%E8%A3%85%E9%A5%B0%E5%99%A8property"><span class="nav-number">11.</span> <span class="nav-text">类中装饰器property</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%85%83%E7%B1%BB"><span class="nav-number">12.</span> <span class="nav-text">元类</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%8F%8D%E5%B0%84"><span class="nav-number">13.</span> <span class="nav-text">反射</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%8C%B4%E5%AD%90%E8%A1%A5%E4%B8%81"><span class="nav-number">14.</span> <span class="nav-text">猴子补丁</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BB%80%E4%B9%88%E6%98%AF%E9%9D%A2%E5%90%91%E8%BF%87%E7%A8%8B%E5%92%8C%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1-1"><span class="nav-number">15.</span> <span class="nav-text">什么是面向过程和面向对象</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E4%B8%89%E8%A6%81%E7%B4%A0-1"><span class="nav-number"></span> <span class="nav-text">面向对象三要素:</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E4%BA%94%E5%A4%A7%E5%8E%9F%E5%88%99%EF%BC%9A%E4%BA%86%E8%A7%A3%E4%B8%89%E4%B8%AA%E5%8D%B3%E5%8F%AF"><span class="nav-number"></span> <span class="nav-text">面向对象五大原则：了解三个即可</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E7%9A%84mro%EF%BC%9A"><span class="nav-number"></span> <span class="nav-text">面向对象的mro：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#super-%E6%96%B9%E6%B3%95%EF%BC%9A"><span class="nav-number"></span> <span class="nav-text">super()方法：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#self%E6%8C%87%E9%92%88%EF%BC%9A"><span class="nav-number"></span> <span class="nav-text">self指针：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#isinstance%E6%96%B9%E6%B3%95%EF%BC%9A"><span class="nav-number"></span> <span class="nav-text">isinstance方法：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#python%E4%B8%AD%E7%9A%84%E9%AD%94%E6%B3%95%E6%96%B9%E6%B3%95%EF%BC%9A"><span class="nav-number"></span> <span class="nav-text">python中的魔法方法：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%89%B9%E6%AE%8A%E7%9A%84%E9%AD%94%E6%B3%95%E6%96%B9%E6%B3%95%EF%BC%9A"><span class="nav-number"></span> <span class="nav-text">特殊的魔法方法：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%9D%99%E6%80%81%EF%BC%8C%E7%B1%BB%E6%96%B9%E6%B3%95%E7%9A%84%E5%8C%BA%E5%88%AB%EF%BC%9A"><span class="nav-number"></span> <span class="nav-text">静态，类方法的区别：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%B1%BB%E4%B8%AD%E8%A3%85%E9%A5%B0%E5%99%A8property%EF%BC%9A"><span class="nav-number"></span> <span class="nav-text">类中装饰器property：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%85%83%E7%B1%BB%EF%BC%9A"><span class="nav-number"></span> <span class="nav-text">元类：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%8F%8D%E5%B0%84%EF%BC%9A"><span class="nav-number"></span> <span class="nav-text">反射：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%8C%B4%E5%AD%90%E8%A1%A5%E4%B8%81%EF%BC%9A"><span class="nav-number"></span> <span class="nav-text">猴子补丁：</span></a></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">X y</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/wow/archives/">
        
          <span class="site-state-item-count">23</span>
          <span class="site-state-item-name">المقالات</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
        <span class="site-state-item-count">1</span>
        <span class="site-state-item-name">التصنيفات</span>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">1</span>
        <span class="site-state-item-name">الوسوم</span>
      </div>
  </nav>
</div>



        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="Back to top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-hans">
    <link itemprop="mainEntityOfPage" href="https://single-flower.gitee.io/wow/2021/04/13/SD/%E9%9D%A2%E8%AF%95%E9%A2%98_%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A19/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/wow/images/avatar.gif">
      <meta itemprop="name" content="X y">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="朵朵最可爱">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          面向对象9
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">نُشر في</span>

      <time title="أُنشأ: 2021-04-13 14:15:03" itemprop="dateCreated datePublished" datetime="2021-04-13T14:15:03+08:00">2021-04-13</time>
    </span>
      <span class="post-meta-item">
        <span class="post-meta-item-icon">
          <i class="far fa-calendar-check"></i>
        </span>
        <span class="post-meta-item-text">عُدل في</span>
        <time title="عُدل: 2021-04-15 21:14:06" itemprop="dateModified" datetime="2021-04-15T21:14:06+08:00">2021-04-15</time>
      </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">في</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/wow/categories/GIT/" itemprop="url" rel="index"><span itemprop="name">-GIT</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h3 id="什么是面向过程和面向对象"><a href="#什么是面向过程和面向对象" class="headerlink" title="什么是面向过程和面向对象"></a>什么是面向过程和面向对象</h3><h3 id="面向对象三要素"><a href="#面向对象三要素" class="headerlink" title="面向对象三要素"></a>面向对象三要素</h3><h3 id="面向对象五大原则"><a href="#面向对象五大原则" class="headerlink" title="面向对象五大原则"></a>面向对象五大原则</h3><h3 id="面向对象的mro"><a href="#面向对象的mro" class="headerlink" title="面向对象的mro"></a>面向对象的mro</h3><h3 id="super-方法"><a href="#super-方法" class="headerlink" title="super()方法"></a>super()方法</h3><h3 id="self指针"><a href="#self指针" class="headerlink" title="self指针"></a>self指针</h3><h3 id="isinstance方法"><a href="#isinstance方法" class="headerlink" title="isinstance方法"></a>isinstance方法</h3><h3 id="python中的魔法方法"><a href="#python中的魔法方法" class="headerlink" title="python中的魔法方法"></a>python中的魔法方法</h3><h3 id="特殊的魔法方法"><a href="#特殊的魔法方法" class="headerlink" title="特殊的魔法方法"></a>特殊的魔法方法</h3><h3 id="静态，类方法的区别"><a href="#静态，类方法的区别" class="headerlink" title="静态，类方法的区别"></a>静态，类方法的区别</h3><h3 id="类中装饰器property"><a href="#类中装饰器property" class="headerlink" title="类中装饰器property"></a>类中装饰器property</h3><h3 id="元类"><a href="#元类" class="headerlink" title="元类"></a>元类</h3><h3 id="反射"><a href="#反射" class="headerlink" title="反射"></a>反射</h3><h3 id="猴子补丁"><a href="#猴子补丁" class="headerlink" title="猴子补丁"></a>猴子补丁</h3><h3 id="什么是面向过程和面向对象-1"><a href="#什么是面向过程和面向对象-1" class="headerlink" title="什么是面向过程和面向对象"></a>什么是面向过程和面向对象</h3><pre><code>--有一天你想吃鱼香肉丝了，怎么办呢？你有两个选择
1、自己买材料，肉，鱼香肉丝调料，蒜苔，胡萝卜等等然后切菜切肉，开炒，盛到盘子里。
2、去饭店，张开嘴：老板！来一份鱼香肉丝！
看出来区别了吗？1是面向过程2是面向对象(优势就是降低耦合，提高维护性)</code></pre>
<h2 id="面向对象三要素-1"><a href="#面向对象三要素-1" class="headerlink" title="面向对象三要素:"></a>面向对象三要素:</h2><pre><code>--1、封装
隐藏实现细节，使得代码模块化
封装的意义：在于保护或者防止代码被我们无意中破坏
2、继承
可以扩展已存在的代码模块-------目的代码重用
3、多态
一个接口，多种方法
接口重用</code></pre>
<h2 id="面向对象五大原则：了解三个即可"><a href="#面向对象五大原则：了解三个即可" class="headerlink" title="面向对象五大原则：了解三个即可"></a>面向对象五大原则：了解三个即可</h2><pre><code>--单一职责  原则   SRP
类的功能要单一，不能包罗万象，跟杂货铺似的。
--开放封闭  原则   OCP
一个模块对于拓展是开放的，对于修改是封闭的，想要增加功能热烈欢迎，想要修改，哼，一万个不乐意。
--里式替换  原则   LSP
子类可以替换父类出现在父类能够出现的任何地方。比如你能代表你爸去你姥姥家干活。哈哈~~</code></pre>
<h2 id="面向对象的mro："><a href="#面向对象的mro：" class="headerlink" title="面向对象的mro："></a>面向对象的mro：</h2><pre><code>--也就是继承查询顺序

--多继承时的顺序：
python2是深度优先  一条路走到底
python3是广度优先 先一条路走到倒数第二级 判断如果有别的路能走到终点 就返回</code></pre>
<h2 id="super-方法："><a href="#super-方法：" class="headerlink" title="super()方法："></a>super()方法：</h2><pre><code>--在子类中获取父类的一个方法
还可以解决多继承问题
好处就是可以避免直接使用父类的名字，主要用于多重继承


三个类 都有共同一个方法，第三个类中super().m 后  再调用第三个类
如果没有super()这个方法它就会再执行一个AB，有了就不用了  直接一遍即可</code></pre>
<h2 id="self指针："><a href="#self指针：" class="headerlink" title="self指针："></a>self指针：</h2><pre><code>--self代表类的实例，而非类</code></pre>
<p>self的用法</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Test</span>:</span></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">prt</span>(<span class="params">self</span>):</span></span><br><span class="line">        print(self)</span><br><span class="line">        print(self.__class__)</span><br><span class="line"> </span><br><span class="line">t = Test()</span><br><span class="line">t.prt()</span><br></pre></td></tr></table></figure>
<p>执行结果如下</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">&lt;__main__.Test <span class="built_in">object</span> at <span class="number">0x000000000284E080</span>&gt;</span><br><span class="line">&lt;<span class="class"><span class="keyword">class</span> &#x27;<span class="title">__main__</span>.<span class="title">Test</span>&#x27;&gt;</span></span><br></pre></td></tr></table></figure>
<p>self不必非写成self     写成什么都一样</p>
<h2 id="isinstance方法："><a href="#isinstance方法：" class="headerlink" title="isinstance方法："></a>isinstance方法：</h2><pre><code>--类似于type</code></pre>
<h2 id="python中的魔法方法："><a href="#python中的魔法方法：" class="headerlink" title="python中的魔法方法："></a>python中的魔法方法：</h2><pre><code>--python中的魔法方法总是被双下划线__包围，比如：__init__()
魔法方法的魔法就体现在他们会在需要的时候被自动调用</code></pre>
<h2 id="特殊的魔法方法："><a href="#特殊的魔法方法：" class="headerlink" title="特殊的魔法方法："></a>特殊的魔法方法：</h2><h2 id="静态，类方法的区别："><a href="#静态，类方法的区别：" class="headerlink" title="静态，类方法的区别："></a>静态，类方法的区别：</h2><h2 id="类中装饰器property："><a href="#类中装饰器property：" class="headerlink" title="类中装饰器property："></a>类中装饰器property：</h2><h2 id="元类："><a href="#元类：" class="headerlink" title="元类："></a>元类：</h2><h2 id="反射："><a href="#反射：" class="headerlink" title="反射："></a>反射：</h2><h2 id="猴子补丁："><a href="#猴子补丁：" class="headerlink" title="猴子补丁："></a>猴子补丁：</h2>
    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/wow/tags/GIT/" rel="tag"># -GIT</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/wow/2021/04/13/SD/%E9%9D%A2%E8%AF%95%E9%A2%98_%E5%87%BD%E6%95%B0%E8%BF%9B%E9%98%B67/" rel="prev" title="函数进阶7">
                  <i class="fa fa-chevron-left"></i> 函数进阶7
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/wow/2021/04/13/SD/%E9%9D%A2%E8%AF%95%E9%A2%98_%E5%87%BD%E6%95%B0%E5%9F%BA%E7%A1%806/" rel="next" title="函数基础6">
                  函数基础6 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>







<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      const activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      const commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">X y</span>
</div>
  <div class="powered-by">تطبيق الموقع <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/muse/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a>
  </div>

    </div>
  </footer>

  
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js"></script>
<script src="/wow/js/utils.js"></script><script src="/wow/js/motion.js"></script><script src="/wow/js/schemes/muse.js"></script><script src="/wow/js/next-boot.js"></script>

  






  





</body>
</html>
